import request from '@/router/axios'
import { baseUrl } from '@/config/env'
export const loginByUsername = (staffNumber, password, ticket) => request({
  url: baseUrl + '/pc/per-teacher/login',
  method: 'post',
  meta: {
    isToken: false
  },
  data: {
    staffNumber,
    password,
    ticket
  }
})

export const getUser = (data) => request({
  url: baseUrl + '/pc/per-teacher/department',
  method: 'get',
  params: data
})

export const updateUser = (data) => request({
  url: baseUrl + '/pc/per-teacher/user',
  method: 'put',
  data
})

export const deleteUser = (data) => request({
  url: baseUrl + '/pc/per-teacher',
  method: 'delete',
  data
})

export const addUser = (data) => request({
  url: baseUrl + '/pc/per-teacher',
  method: 'post',
  data
})

export const getUserInfo = () => request({
  url: baseUrl + '/floor',
  method: 'get'
})

export const refeshToken = () => request({
  url: baseUrl + '/user/refesh',
  method: 'post'
})

export const getMenu = () => request({
  url: baseUrl + '/pc/per-teacher/menu',
  method: 'get'
})

export const getRootMenu = () => request({
  url: baseUrl + '/admin/acl/menu/root',
  method: 'get'
})

export const getTopMenu = () => request({
  url: baseUrl + '/user/getTopMenu',
  method: 'get'
})

export const sendLogs = (list) => request({
  url: baseUrl + '/admin/logout',
  method: 'post',
  data: list
})

export const logout = () => request({
  url: baseUrl + '/pc/per-teacher/logout',
  method: 'post'
})
